﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{

    public class MLABCDRebarRecord : RebarBase
    {
        //public int Radius, r, h, n, Lx, A, B, C, D ,h;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mBarMark">钢筋主编号，例如1</param>
        /// <param name="sBarMark">钢筋次编号，例如1.1，默认为0</param>
        /// <param name="cBarMark">钢筋字符编号，例如1a，默认为空</param>
        /// <param name="diameter">钢筋直径，按eDB选取</param>   
        /// <param name="h"></param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="c"></param>
        /// <param name="d"></param>
        /// <param name="quantity"></param>
        /// <param name="shapeConfg"></param>
        public MLABCDRebarRecord(int mBarMark, int sBarMark, string cBarMark, eDB diameter,
           int h,   int a, int b, int c, int d,
            int quantity, eShapeType shapeConfig):base(mBarMark,sBarMark,cBarMark,diameter,quantity,shapeConfig)
        {
            
            this.r = RebarKnowledge.GerRadius(diameter);
            this.d = PublicEnumItems.GeteDBData(diameter.ToString());
            this.h = h;
            A = a;
            B = b;
            C = c;
            D = d;

            Formula = "L=A+B+C+D+H-r-2d";
            

        }

        public override void SetLength()
        {
            Length =Math.Round((A+B+C+D+h-r-2*d) * 0.001, 3, MidpointRounding.AwayFromZero) ;
        }
    }
}
